<template>
  <v-card>
    <v-card-title class="mb-2" v-show="roleName !== '2'">
      <document-action-menu />
      <document-deletion-button class="ms-2" />
    </v-card-title>
    <document-list />
  </v-card>
</template>

<script>
import { mapState } from 'vuex'
import DocumentList from '@/components/containers/documents/DocumentList'
import DocumentActionMenu from '@/components/containers/documents/DocumentActionMenu'
import DocumentDeletionButton from '@/components/containers/documents/DocumentDeletionButton'
export default {
  layout: 'project',
  data() {
    return {
      roleName: null
    }
  },
  computed: {
    ...mapState('members', ['items', 'selected', 'loading'])
  },
  components: {
    DocumentList,
    DocumentActionMenu,
    DocumentDeletionButton
  },

  validate({ params, query }) {
    return (
      /^\d+$/.test(params.id) &&
      /^\d+|$/.test(query.limit) &&
      /^\d+|$/.test(query.offset)
    )
  },
  // 创建判断用户权限 是否满足状态 传递给 button是否存在
  created() {
    this.roleName = localStorage.getItem('userId')
    console.log(this.roleName)
  }
}
</script>
